
                                    function checkSearch() {
                                        var f = document.forms['search'];
                                        if(!f) {
                                            alert('Wrong form!');
                                        }
                                        /*var e = document.getElementById('ptCC');
                                        if(e.checked==false) {
                                            return true;
                                        }*/
                                        err = '';
                                        e = f.elements['cc_fname'];
                                        if(!e || e.value=='') {
                                            err += "\n\tType your first name";
                                        }
                return true;
                }


function submitsearchform(newval){
if(newval != ''){
        f = document.forms['searchform'];
        hiddenval = f.elements['search_n'];
        hiddenval.value = newval;
        f.submit();
        return true;
        }
else{
        
        return false;
        }

}

function submitsubscribeform(name,email){
f = document.forms['signupform'];

var err = '';
if(name != ''){
        f.elements['name'].value = name;
}
else{
        err += "Please type your name. \n";
}

    
                       
    function getRadioValue(f, rkey)
    {
        for(i=0; i<f.elements[rkey].length;i++)
        {
            if(true == f.elements[rkey][i].checked)
            {
                resolution = f.elements[rkey][i].value;
                return f.elements[rkey][i].value;
            }
        }
        return -1;
    }
    

if(email != ''){
    var re = new RegExp("^[a-zA-Z]+[0-9a-zA-Z_]+@[0-9a-zA-Z]+[\.][a-zA-Z]+$");
    if(re.exec(email) == null)
    {
        err += "\n\tWrong value for Email";
    }
    else{
        f.elements['email'].value = email;
    }
}
else{
        err += "Please type your email. \n";
}

if(err == ''){
        f.submit();
        return true;
}
else{
        alert("Please fill all required field:\n\n"+err);
        return false;
}

}


function newwindow(url, width,  t)
{        
    
 var    LargeWin=window.open(url,"SmallWin","toolbar=no,directories=no,status=no,scrollbars=no,menubar=no,width="+(width+20)+",height="+(height+20));
    LargeWin.window.focus();
} 

function changeStatus(elt, visible) {
    if(visible==false) {
        elt.style.display="none";
    } else {
        elt.style.display="inline";
    }
}

function package_warranty_price_update($div_id){
var x = '';
if(document.forms['detailsformname'].elements['warranty'] != undefined){
x = getRadioValue(document.forms['detailsformname'],'warranty');
}
else{
x = 0;
}

document.getElementById($div_id).value = x;
}


function getRadioValue(f, rkey)
{
for(i=0; i<f.elements[rkey].length;i++)
{
if(true == f.elements[rkey][i].checked)
{
resolution = f.elements[rkey][i].value;
return f.elements[rkey][i].value;
}
}
return -1;
} 


function SetPayment(method) {

    switch (method){


    case 'about' :{
            changeStatus(document.getElementById('about'), true);
            changeStatus(document.getElementById('howto'), false);
            changeStatus(document.getElementById('faq'), false);
            changeStatus(document.getElementById('testemon'), false);
        } break; 

    case 'howto' :{
            changeStatus(document.getElementById('about'), false);
            changeStatus(document.getElementById('howto'), true);
            changeStatus(document.getElementById('faq'), false);
            changeStatus(document.getElementById('testemon'), false);
        } break; 

    case 'faq' :{
            changeStatus(document.getElementById('about'), false);
            changeStatus(document.getElementById('howto'), false);
            changeStatus(document.getElementById('faq'), true);
            changeStatus(document.getElementById('testemon'), false);
        } break; 

    case 'testemon' :{
            changeStatus(document.getElementById('about'), false);
            changeStatus(document.getElementById('howto'), false);
            changeStatus(document.getElementById('faq'), false);
            changeStatus(document.getElementById('testemon'), true);
        } break; 



    case 1 :{
            changeStatus(document.getElementById('img0'), false);
            changeStatus(document.getElementById('img1'), true);
            changeStatus(document.getElementById('img2'), false);
            changeStatus(document.getElementById('img3'), false);
            changeStatus(document.getElementById('about'), true);
        } break; 
    case 2 :{
            changeStatus(document.getElementById('img0'), false);
            changeStatus(document.getElementById('img1'), false);
            changeStatus(document.getElementById('img2'), true);
            changeStatus(document.getElementById('img3'), false);
            changeStatus(document.getElementById('about'), true);
        } break; 
    case 3 :{
            changeStatus(document.getElementById('img0'), false);
            changeStatus(document.getElementById('img1'), false);
            changeStatus(document.getElementById('img2'), false);
            changeStatus(document.getElementById('img3'), true);
            changeStatus(document.getElementById('about'), true);
        } break; 

    case 0 :{
            changeStatus(document.getElementById('img0'), true);
            changeStatus(document.getElementById('img1'), false);
            changeStatus(document.getElementById('img2'), false);
            changeStatus(document.getElementById('img3'), false);
            changeStatus(document.getElementById('about'), true);
        } break; 


    }

}

function newwindow(url, width, height)
{        
    
 var    LargeWin=window.open(url,"SmallWin","toolbar=no,directories=no,status=no,scrollbars=no,menubar=no,width="+(width+20)+",height="+(height+20));
    LargeWin.window.focus();
} 

                        function qplus(id, qty) {
                                var iid = "q"+id;
                                var qinput = document.getElementById(iid);
                                if (qinput.value<qty) {
                                        qinput.value++;
                                }
                        }
                        function qminus(id) {
                                var iid = "q"+id;
                                var qinput = document.getElementById(iid);
                                if (qinput.value>1) {
                                        qinput.value = qinput.value-1;
                                }
                        }


